//创建界面的js
var optionNum = 2;

var userOptionNum = 1;

var $cOption;

var $cMsg;

function createCompanyInit() {
	var id = $('#id').val();
	
	if(id){
		getContent("/company/find", 'id=' + id, true, function(data) {
			if (data != null) {
				$('#name').val(data.name);
				$('#memo').val(data.memo);
				$('#type').select2('val',data.type);				
			}
		});
	}
}

function saveCompany() {

	var data = {};
	data.id = $('#id').val();
	data.name = $('#name').val();
	data.memo = $('#memo').val();
	data.type = $('#type').val();
	var jdata = JSON.stringify(data);
	postContent("/company/save", jdata, true, function(data) {
		if (data != null) {
			alert('保存成功!');
		}
	});
}